# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime

from django.db import models
from blog.models import Blog
# Create your models here.


class Comments(models.Model):
    comments_type = models.CharField(max_length=10, choices=(('news', u'新闻'), ('blog', u'博客')), default='blog', verbose_name=u'评论类别')
    comments_author = models.CharField(max_length=10, verbose_name=u'评论作者')
    comments_create_time = models.DateTimeField(default=datetime.now, verbose_name=u'评论创建时间')
    comments_desc = models.CharField(max_length=200, verbose_name=u'评论描述')
    blog_comments = models.ForeignKey(Blog, verbose_name=u'博客评论')

    class Meta:
        verbose_name = u'评论'
        verbose_name_plural = verbose_name

    def __unicode__(self):
        return self.blog_comments.blog_title
